﻿#ifndef MESSAGESTANDARDITEMMODEL_H
#define MESSAGESTANDARDITEMMODEL_H

#include <QStandardItemModel>
#include "message.h"

class MessageStandardItemModel : public QStandardItemModel
{
    Q_OBJECT
public:
    explicit MessageStandardItemModel(QObject *parent = nullptr);

    QStringList headerClient;
    QStringList headerGiver;

    void setType(int type);

    void setHeader();

    void reset();

    void insertMessage(Message &message);

    void insertMessage(QList<Message*> messages);

    void refreshTotalValue();

signals:
    void updateTotalValue(double totalTicket, double totalMoney);

public slots:

private:
    QList<Message*> messages;

    int type;
    QStringList header;

    int ticketIndex;
    int moneyIndex;
};

#endif // MESSAGESTANDARDITEMMODEL_H
